<include file="public@header">
<link rel="stylesheet" href="__STATIC__/hybit/css/new_style.css">
<body>
    <a href="{:url('parent_son/parent_record')}" class="agojilu"><img src="__STATIC__/hybit/images/jilu.png" alt=""></a>
    <div class="bgbg headhead">
        <p class="mytitle">{:lang('Sub account list')}</p>
        <div class="z_zzhlist">
            <foreach name="list" item="vo">
                <div class="z_zzhlistshow">
                    <img src="__STATIC__/hybit/images/xt-set.png" alt="">
                    <p>{$vo['mobile']?$vo['mobile']:$vo['user_email']}</p>
                    <a class="unbundling" data-id="{$vo.id}">{:lang('Unbundling')}</a>
                </div>
            </foreach>
            <a href="{:url('parent_son/bind')}" class="z_zzhlistbtn">{:lang('Bind sub account')}</a>
        </div>
    </div>
</body>
<script src="__STATIC__/js/jquery.js"></script>
<script src="__STATIC__/layui/layui.js"></script>
<script type="text/javascript">
layui.use(['form','layer'],function(){
    var layer = layui.layer,
        form = layui.form;

    $('.unbundling').click(function(){
        var id = $(this).data('id');
        layer.msg('{:lang("Confirm the operation")}?', {
            shade:0,
            time:0,
            btn: ['{:lang("Confirm")}', '{:lang("Cancel")}'],
            btn1:function(index,layero){
                $.ajax({
                    type: 'post',
                    url: '{:url("parent_son/unbundling")}',
                    data:{id:id,type:1},
                    success:function(res){
                        layer.msg(res.msg);
                        if(res.code == 1){
                            setTimeout(function(){ location.reload(); }, 1500);
                        }
                    }
                });
            },
        });
    });

});
</script>
</html>